import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus';
// import 'element-plus/lib/theme-chalk/index.css';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn'

import axios from 'axios'
import VueAxios from 'vue-axios'
// VueAxios 与 axios 的位置不能交换，否则出现 TypeError: Cannot read property 'protocol' of undefined
// Vue.use( VueAxios , axios)

import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import * as ElIcons from '@element-plus/icons'

// const app = createApp(App)
// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//     app.component(key, component)
// }

import'@/assets/css/global.css'

createApp(App).use(store).use(router).use(ElementPlus,{zhCn,size:''}).use( VueAxios , axios).mount('#app')
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// for (const name in ElIcons){
//     app.component(name,(ElIcons as any)[name])
// }
